package com.eastcom.collection
import java.awt.TexturePaintContext.Int;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetAddress.Cache;
import java.sql.Date;
import java.sql.PreparedStatement
import java.sql.SQLException
import java.sql.Timestamp
import java.sql.Types;
import java.text.SimpleDateFormat
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;

import com.eastcom.collection.tools.db.DbEngine
import com.eastcom.groovy.provider.*
import com.eastcom.groovy.tools.mail.*
import com.sun.java.util.jar.pack.Instruction.Switch;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.bcel.internal.util.ClassPath.Dir;
import com.eastcom.collection.provider.*
import com.eastcom.collection.config.PmFile
import com.eastcom.collection.config.NrmFile;
import com.eastcom.collection.context.*
import com.eastcom.collection.tools.file.JaxbUtil

import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory;
import org.apache.commons.net.ftp.FTPFile
import org.apache.commons.net.ftp.FTPFileFilter
import org.springframework.dao.DataAccessException
import org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback
import org.springframework.jdbc.support.lob.LobCreator
import org.springframework.jdbc.support.lob.OracleLobHandler
import org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
class Test {

	static main(args) {
		String beginTime = "2014-11-07T13:15:00+08:00".replaceAll("T", " ")
		beginTime = beginTime.replaceAll("\\+08:00", "")
		println beginTime
//		PmFile pmFile = JaxbUtil.converyFileToJavaBean("C:\\Users\\Administrator.W1XAR6UBANV9ZQM\\Desktop\\udp\\local/test/W_Nokia_SGSN_Nokia-ALL-OMC2_PM_SgsnFunction_881_15_20141010-1630.xml", "UTF-8", PmFile.class)
//		pmFile.Measurements.each {
//			for(int i = 0; i < it.PmName.N.size(); i++){
//				String id = it.PmName.N[i].i
//				print "PmName-N:"+it.PmName.N[i].i+"---"+it.PmName.N[i].value+"--PmData:["
//				boolean isFind = false
//				for(int j = 0; j < it.PmData.Pm.size(); j++){
//					if(it.PmData.Pm[j].V != null){
//						for(int a = 0; a < it.PmData.Pm[j].V.size(); a++){
//							if(it.PmData.Pm[j].V[a].i.equals(id)){
//								print it.PmData.Pm[j].Dn+"---"+it.PmData.Pm[j].UserLabel+"---"+it.PmData.Pm[j].V[a].value+"---"
//								isFind = true
//								break
//							}
//						}
//					}
//					if(! isFind){
//						if(it.PmData.Pm[j].CV != null){
//							for(int a = 0; a < it.PmData.Pm[j].CV.size(); a++){
//								if(it.PmData.Pm[j].CV[a].i.equals(id)){
//									for(int b = 0; b < it.PmData.Pm[j].CV[a].SN.size(); b++){
//										print it.PmData.Pm[j].CV[a].SN[b]+"---"+it.PmData.Pm[j].CV[a].SV[b]+","
//									}
//									break
//								}
//							}
//						}
//					}
//	
//					println "]"
//				}
//				
//			}
		
		
		
//			NrmFile pmFileV2 = JaxbUtil.converyFileToJavaBean("C:\\Users\\Administrator.W1XAR6UBANV9ZQM\\Desktop\\udp\\local/test/W_Nokia_SGSN_Nokia-ALL-OMC2_CM_EthernetPort_880_1440_20141009-0230.xml", "UTF-8", NrmFile.class)
//			
//			pmFileV2.Objects.each {
//				for(int i = 0; i < it.FieldName.N.size(); i++){
//					String id = it.FieldName.N[i].i
//					print "PmName-N:"+it.FieldName.N[i].i+"---"+it.FieldName.N[i].value+"--PmData:["
//					boolean isFind = false
//					for(int j = 0; j < it.FieldValue.Cm.size(); j++){
//						if(it.FieldValue.Cm[j].V != null){
//							for(int a = 0; a < it.FieldValue.Cm[j].V.size(); a++){
//								if(it.FieldValue.Cm[j].V[a].i.equals(id)){
//									print "---"+it.FieldValue.Cm[j].V[a].value+"---"
//									isFind = true
//									break
//								}
//							}
//						}
//						if(! isFind){
//							if(it.FieldValue.Cm[j].CV != null){
//								for(int a = 0; a < it.FieldValue.Cm[j].CV.size(); a++){
//									if(it.FieldValue.Cm[j].CV[a].i.equals(id)){
//										for(int b = 0; b < it.FieldValue.Cm[j].CV[a].SN.size(); b++){
//											print it.FieldValue.Cm[j].CV[a].SN[b]+"---"+it.FieldValue.Cm[j].CV[a].SV[b]+","
//										}
//										break
//									}
//								}
//							}
//						}
//		
//						println "]"
//					}
//					
//				}
	}

}
